<script lang="ts" setup>
import ProductBox from "../Common/ProductBox.vue";
import Tip from "../Common/Tip.vue";
import { reactive, ref } from "vue";

const radio = ref(1);
const form = reactive({
  name: "",
  region: "",
  date1: "",
  date2: "",
  delivery: false,
  type: [],
  desc: "",
});

const onSubmit = () => {
  console.log("submit!");
};

const drawer = ref(false);
</script>
<template>
  <div class="pl-5 pr-5">
    <ProductBox title="申请发票" :back="true">
      <Tip :show-icon="false" class="mb-20">
        发票审核会在
        <span class="text-red-600">1-7</span>
        个工作日内处理完成，请耐心等待；
      </Tip>

      <div class="w-full flex-col flex items-center">
        <el-form :model="form" label-width="auto" class="w-full" style="max-width: 600px" label-position="top">
          <el-form-item label="申请开票金额:">
            <el-input v-model="form.name" class="w-30" />
            <span>元</span>
            <span class="ml-5">
              可开票金额：
              <span class="text-red-500">0元</span>
            </span>
          </el-form-item>
          <el-form-item label="发票性质">
            <el-radio-group v-model="radio">
              <el-radio :value="1">电子</el-radio>
              <span class="text-sm text-red-600">
                开具电子发票没有电子章，
                <a href="javascript: void(0)" class="text-blue-600" @click="drawer = true">
                  查看说明
                </a>
              </span>
            </el-radio-group>
          </el-form-item>

          <el-form-item label="电子邮箱:">
            <el-input v-model="form.name" />
          </el-form-item>
          <el-form-item label="备注">
            <el-input v-model="form.desc" type="textarea" class="w-200" />
          </el-form-item>
          <el-form-item>
            <el-button type="primary" @click="onSubmit">提交</el-button>
            <el-button>取消</el-button>
          </el-form-item>
        </el-form>
      </div>
    </ProductBox>

    <el-drawer v-model="drawer" title="I am the title" :with-header="false">
      <p>发票说明。。。</p>
      <p>发票说明。。。</p>
      <p>发票说明。。。</p>
      <p>发票说明。。。</p>
      <p>发票说明。。。</p>
      <p>发票说明。。。</p>
      <p>发票说明。。。</p>
      <p>发票说明。。。</p>
      <p>发票说明。。。</p>
      <p>发票说明。。。</p>
    </el-drawer>
  </div>
</template>
<style lang="scss" scoped></style>
